import { Alert, Text, TextInput, TouchableOpacity, View } from 'react-native'
import { withNavigationItem } from 'hybrid-navigation'
import { useEffect } from 'react'

export default withNavigationItem({ titleItem: { title: '测试页' } })(TestPage)

export function TestPage() {
  useEffect(() => {
    for (let i = 0; i < 1000000; i++) {
      console.log(i)
    }
  }, [])

  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'flex-start' }}>
      <TouchableOpacity
        style={{
          width: 100,
          height: 100,
          backgroundColor: 'rgba(255,0,0,0.5)',
          position: 'absolute',
          top: 0,
          left: 0,
        }}
        onPress={() => Alert.alert('111')}></TouchableOpacity>

      <View
        pointerEvents={'none'}
        style={{
          width: 100,
          height: 100,
          backgroundColor: '#00FF00',
          position: 'absolute',
          top: 0,
          left: 0,
        }}></View>
    </View>
  )
}
